#include <iostream>

using namespace std; 

int a[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int n;
int cnt;

int calc(int x)
{
	if(x == 0) return 6;
	int ret = 0;
	while(x)
	{
		int t = x % 10;
		ret += a[t];
		x /= 10;
	}
	return ret;
}

int main()
{
	cin >> n;
	n -= 4;
	for(int a = 0; a < 1000; a++)
	{
		for(int b = 0; b < 1000; b++)
		{
			int c = a + b;
			if(calc(a) + calc(b) + calc(c) == n) cnt++;
		}
	}
	cout << cnt << endl;
	return 0;
}
